<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="page-enter" content="blendTrans(Duration=0.5)">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="expires" content="Sat, 10 August 2011 23:59:59 GMT">
<meta http-equiv="pragma" content="no-cache">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="Parelli">
<meta name="publisher" content="Parelli">
<meta name="copyright" content="&copy; 2011. Parelli">
<meta name="page-topic" content="Parelli index page">
<meta name="distribution" content="global">
<meta name="content-language" content="en">
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="30 days">
<link href="/asset/img/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="/asset/img/favicon.ico" rel="icon" type="image/x-icon">
<style type="text/css" title="currentStyle" media="all">/*<![CDATA[*/@import url("asset/css/class_global.css");/*]]>*/</style>
<?php echo $css; ?>
<title><?php echo $title; ?></title>
<script type="text/javascript" src="asset/js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="asset/css/class_searchbox.css" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="asset/js/script.js"></script>


</head>

<body>
<div class="wrapper">
	<div id="top">
    	<div class="left">
        	<div id="logo">
                <a href="http://jcu.edu.sg/"><img src="asset/img/jcu-logo.png" /></a>
            </div>
        </div>
        <div class="left">
        	<div id="big_search">
            	<div id="big_search_box">
                 <form id="searchform">
                	<input type="text" onkeyup="lookup(this.value);" id="big_search_text" name="search_txt" value="search book" /> <input type="submit" id="search_btn" value="" />
                </form>
                	<div id="suggestions"></div>
                </div>
                <div id="advanced_search"><a href="advanced_search.php">advanced search</a></div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div id="navigation">
	<div class="wrapper">
    	<div id="book_square"><a href="index.php"><img src="asset/img/booksquare-logo.png" /></a></div>
        <div id="nav_box">
            <ul id="nav">
            <?php
			switch ($page_name)
			{
				case "my_book":
					$status_my_book = "active";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="";
				break;
				case "notification":
					$status_my_book = "";
					$status_notification = "active";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="";
				break;
				case "sell_book":
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "active";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="";
				break;
				case "book_on_sell":
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "active";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="";
				break;
				case "requested_book":
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "active";
					$status_faq = "";
					$status_request_book="";
				break;
				case "faq":
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "active";
					$status_request_book="";
				break;
				case "request_book":
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="active";
				break;
				default:
					$status_my_book = "";
					$status_notification = "";
					$status_sell_book = "";
					$status_book_on_sell = "";
					$status_requested_book = "";
					$status_faq = "";
					$status_request_book="";
				break;
			}
            echo '<li><a href="my_book.php" id="' .$status_my_book . '">My Book</a></li>
                <li><a href="notification.php" id="' .$status_notification . '">Notification</a></li>
                <li><a href="sell_book.php" id="' .$status_sell_book . '">Sell Book</a></li>       
                <li><a href="book_to_sell.php" id="' .$status_book_on_sell . '">Book on Sale</a></li>
                <li><a href="request_book.php" id="' .$status_request_book . '">Request Book</a></li>
                <li><a href="requested_book.php" id="' .$status_requested_book . '">Requested Book</a></li>
                <li><a href="faq.php" id="' .$status_faq . '">FAQ</a></li>
				';
			?>
            </ul>
        </div>
        <?php
        $uid=$_SESSION["userid"];
		$sql = "select fname from M_USER a where user_id=".$uid;
		if (!mysql_query($sql,$con))
		{
			die('Error: ' . mysql_error());
		}
		$result = mysql_query($sql);
		while($row = mysql_fetch_array($result))
		{
			$fname = $row['fname'];
		}
		
        echo '<div id="user_area">
        	Hi, <a href="" style="background:url(asset/img/arrow-logout.png) no-repeat right;"><span style="padding-right:20px;">' .$fname . '</span></a>
            <div id="logout_area">
				<ul>
					<li><a href="my_profile.php">My Profile</a></li>
					<li><a href="logout.php">Logout</a></li>
				</ul>
			</div>
        </div>';
        ?>
        <div class="clear"></div>
    </div>
</div>